#ifndef _SOA_H_
#define _SOA_H_


#include "../../container/queue/Queue.h"
#include "../service/Service.h"

/*
	class : Soa
	desc : This is a class to represent the
		software oriented architecture and
		it is used to make it easier to deal to
		communications between devices by representing
		them as requests of services. For example if you want
		to read or write to usart you represent read and write
		as services and submit a request to the soa for the service.
*/
class Soa
{
	public:

		Service* currentService;
		//registered services that soa can run.
		Vector<Service*> registeredServices;
		//the unsigned char gives the index of the registered service
		Queue<unsigned char> requests;

		//constructor
		Soa();
		
		//adds a service request to the requested services
		//you will want to have an enum declared in here
		void addRequest(unsigned char s);
		//runs the next requested services until finished
		//current service is not finished continues 
		//running that service to completion
		void run();
};




#endif
